<%@ page language="java" contentType="text/html; charset=utf-8"
	pageEncoding="utf-8"
	import="java.util.*,com.telecom.cms.dto.*,com.telecom.cms.dao.*,com.telecom.cms.dbconnect.*"%>
<%@page import="java.sql.Connection"%>

<%@ taglib uri="/WEB-INF/tree.tld" prefix="tree"%>
<%@ taglib uri="/WEB-INF/metric.tld" prefix="metric"%>
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
		<title>Insert title here</title>
		<STYLE type=text/css>
BODY {
	SCROLLBAR-FACE-COLOR: #f2f2f2;
	SCROLLBAR-HIGHLIGHT-COLOR: #f2f2f2;
	SCROLLBAR-SHADOW-COLOR: #b7b7b7;
	SCROLLBAR-3DLIGHT-COLOR: #f2f2f2;
	SCROLLBAR-ARROW-COLOR: #999999;
	SCROLLBAR-TRACK-COLOR: #e9e9e9;
	SCROLLBAR-DARKSHADOW-COLOR: #f2f2f2;
	SCROLLBAR-BASE-COLOR: #f2f2f2;
}
</STYLE>
		<link rel="stylesheet" type="text/css" href="images/main.css">
		<script type="text/javascript" src="js/dtree.js"></script>
		<script>
		var chosedgroup='0';
        function changeParent(tree,nodeId){
	     aNodes = tree.aNodes;
	     checked = document.getElementById(nodeId).checked;
	    if(checked){
		for(var i=0;i<aNodes.length;i++){
			if(aNodes[i].id == aNodes[nodeId].pid){
				document.getElementById(i).checked = checked;
				changeParent(tree,i);
				break;
			}
		}
	}else{
  	sign = 0;
		for(var i=0;i<aNodes.length;i++){
			if(aNodes[i].pid == aNodes[nodeId].pid){
				if(document.getElementById(i).checked){
					sign = 1;
					break;
				}
			}
		}
		if(sign == 0){
			for(var i=0;i<aNodes.length;i++){
				if(aNodes[i].id == aNodes[nodeId].pid){
					document.getElementById(i).checked = checked;
					changeParent(tree,i);
					break;
				}
			}
		}
	}
}

function changeChild(tree,nodeId){
  aNodes = tree.aNodes;
	checked = document.getElementById(nodeId).checked;
	for(var i=0;i<aNodes.length;i++){
		if(aNodes[i].pid == aNodes[nodeId].id){
			document.getElementById(i).checked = checked;
			changeChild(tree,i);
		}
	}
}
function changegroup(o){
	if(chosedgroup!='0'){
		document.getElementById(chosedgroup).style.color='';
		}
		o.style.color='red';
		chosedgroup=o.id;
}

</script>
		<style type="text/css">
<!--
.STYLE1 {
	color: #336699
}
-->
</style>
	</head>
	<body>
		<%
			List list = (List) request.getAttribute("Group");
			String kindId = (String) session.getAttribute("kindId");
			String bid = (String) session.getAttribute("bookmarkid");
		%>
		<table cellspacing="0" cellpadding="0" width="150" border="0">
			<tbody>
				<tr>
					<td width="3" height="31">
						<div id="selclass" style="height: 20px; width: 780px;">
							<metric:m2f precision="<%=kindId%>">
							</metric:m2f>
							<script type="text/javascript">	
								document.getElementById("<%=bid%>").style.color='red';
							</script>
						</div>
					</td>
				</tr>
			</tbody>
		</table>
		<table width="780" border="0" align="left" cellpadding="0"
			cellspacing="0">
			<tr>
				<td align="left" valign="top">
					<table border="0" cellspacing="0" cellpadding="0">
						<tr>
							<%
								int groupid = 0;
								String groupname = null;
								SEG_BIZ_GROUP_DEFDTO sdto = (SEG_BIZ_GROUP_DEFDTO) list.get(0);
								groupid = sdto.getATOM_GROUP_ID();
								groupname = sdto.getATOM_GROUP_NAME();
								for (int i = 0; i < list.size(); i++) {
									SEG_BIZ_GROUP_DEFDTO dto = (SEG_BIZ_GROUP_DEFDTO) list.get(i);
							%>
							<td width="89" valign="bottom" background="images/frame1.gif">
								<script type="text/javascript">changegroup(document.getElementById('<%=groupid%>'))</script>
								<div align="center">
									<a id="<%=dto.getATOM_GROUP_ID()%>"
										href='getatom.do?groupid=<%=dto.getATOM_GROUP_ID()%>&bookmarkid=<%=request.getSession().getAttribute("bookmarkid")%>'
										target="atomArea" class="STYLE1"
										onclick="javascript:changegroup(this);"><%=dto.getATOM_GROUP_NAME()%>
									</a>
								</div>
							</td>
							<td width="5">
								&nbsp;

							</td>
							<%
								}
							%>

						</tr>
					</table>
				</td>
			</tr>
			<tr>
				<td valign="top">
					<table width="100%" border="0" align="center" cellpadding="0"
						cellspacing="0"
						style="BORDER-RIGHT: #D5D5D51px solid; BORDER-TOP: #D5D5D5 1px solid; BORDER-RIGHT: #D5D5D5 1px solid; BORDER-LEFT: #D5D5D5 1px solid; BORDER-BOTTOM: #D5D5D5 1px solid">

						<TR>
							<TD align="center" valign="top" bgcolor="">
								<table width="100%" border="0" align="left" cellpadding="0"
									cellspacing="0">
									<tr>
										<td height="200" align="center" valign="top">
											<iframe name="atomArea" id="atomArea" height=""
												src="getatom.do?groupid=<%=groupid%>&bookmarkid=<%=bid%>" frameborder="0" width="100%"
												scrolling="no"></iframe>
												<% //src="cluster/frame.jsp?id=<%=groupid%" %>
										</td>
									</tr>
									<tr>
										<td align="center" valign="top">
											<iframe src="rsrecord.do" name="rsFrame" id="rsFrame"
												height="" width="100%" frameborder="0" title="rsFrame"
												scrolling="no" />
												<% //src="cluster/rstest.jsp" %>
										</td>
									</tr>
								</table>
							</TD>
						</TR>
					</table>
				</td>
			</tr>
		</table>

	</body>
</html>
